<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>入口文件</title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>

	</head>
	<body>

	</body>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" charset="utf-8">
		//mui初始化
		mui.init({
			keyEventBind: {
				backbutton: false //关闭back按键监听
			}
		});
		//创建子页面，首个选项卡页面显示，其它均隐藏；
		mui.plusReady(function() {
			// 判断用户是否登录 没有登录跳转登录页面
			refresh();
		});

		function refresh() {
			var token = localStorage.getItem('token');
			if (!token) {
				var url = "./html/loging/loging.html";
				mui.openWindow({
					url: url,
					id: url,
					styles: {
						top: '0px', //新页面顶部位置
						bottom: '0px', //新页面底部位置
					}
				});
			} else {
				var url = "./html/main.html";
				mui.openWindow({
					url: url,
					id: url,
					styles: {
						top: '0px', //新页面顶部位置
						bottom: '0px', //新页面底部位置
					}
				});
			}
		}
	</script>
</html>
